import {SEMESTER} from '@/services/api'
import {request, METHOD} from '@/utils/request'

export async function listSemesterByPage(currentPage, size) {
    return request(SEMESTER, METHOD.GET, {
        currentPage: currentPage,
        size: size
    })
}

export async function totalSemester() {
    return request(SEMESTER+"/total", METHOD.GET)
}

export async function deleteSemester(id) {
    return request(SEMESTER, METHOD.DELETE, {
        id: id
    })
}

export async function editSemester(semester) {
    return request(SEMESTER, METHOD.POST, {
        id: semester.id,
        year: semester.year,
        number: semester.number
    })
}
